import tensorflow as tf

W = tf.Variable([[7, 0, 9], [0.55, 113, 12]], dtype=tf.float32);
X = tf.Variable([[1, 3, 3], [0.48, 35, 6]], dtype=tf.float32);

mod = tf.mod(W, X)

d_mod_W = tf.gradients(mod, W)
d_mod_X = tf.gradients(mod, X)

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    
    print('------mod------')
    print(sess.run(mod))
    
    print('------d_mod_W------')
    print(sess.run(d_mod_W))
    print('------d_mod_X------')
    print(sess.run(d_mod_X))